<?php
$str = file_get_contents('18.html');

$preg ='@<h1>.*?</h1>@is';
preg_match_all($preg, $str, $matches);
print_r($matches);